#include <iostream>
#include <cmath>
using namespace std;

int main(){
    int a,b,n;
    cin>>a>>b>>n;
    cout<<a<<","<<b<<","<<n<<endl;
    int x,c;
    x=1;
    c=0;
    while (c!=10){
        if (a*x%b==a*x%n){
            c++;
            cout<<x<<endl;
        }
        x++;
    }
}

